{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f1898fc893bf41a8a78d1bf8b06d4d48",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Plot(antialias=3, axes=['x', 'y', 'z'], background_color=16777215, camera=[20.779741283164306, 12.524741168723…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"Load an existing vtkStructuredGrid and draw the lines of the velocity field joining them in ribbons\"\"\"\n",
    "\n",
    "import vtk\n",
    "from vtkplotter import *\n",
    "\n",
    "######################## vtk\n",
    "# Read the data and specify which scalars and vectors to read.\n",
    "pl3d = vtk.vtkMultiBlockPLOT3DReader()\n",
    "pl3d.SetXYZFileName(datadir+\"combxyz.bin\")\n",
    "pl3d.SetQFileName(datadir+\"combq.bin\")\n",
    "pl3d.SetScalarFunctionNumber(100)\n",
    "pl3d.SetVectorFunctionNumber(202)\n",
    "pl3d.Update()\n",
    "# this vtkStructuredData already contains a vector field:\n",
    "domain = pl3d.GetOutput().GetBlock(0)\n",
    "\n",
    "######################## vtkplotter\n",
    "box = Actor(domain, c=None, alpha=0.1)\n",
    "\n",
    "probe = Line([9,0,28], [11,0,33], res=11).color('k')\n",
    "\n",
    "stream = streamLines(domain, probe, direction='backwards', ribbons=2)\n",
    "\n",
    "show(box, probe, stream, viewup='z')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
